/**
 * Back To Top
 */
define(['jquery'], function ($) {
	var BackToTop;
	BackToTop = (function () {
		function BackToTop () {
			this.scrollToTop();
		}
		BackToTop.prototype.scrollToTop = function () {
			var $scrollToTop = $('#back-to-top');
			// Bind Scroll.
			$(window).on('scroll', function (evt) {
				var top = document.documentElement.scrollTop || document.body.scrollTop;
				if (top > 800) {
					$scrollToTop.show();
				} else {
					$scrollToTop.fadeOut();
				}
			});
			// Scroll To Top
			$scrollToTop.on('click', function (evt) {
				$('html, body').stop().animate({
					scrollTop: 0
				}, 'fast', 'swing');
			});
		};

		return BackToTop;
	})();

	return new BackToTop();
});